package com.yl.module.main.controller;

import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Todo
 *
 * @Author jiangtao
 * @CreateBy 2019-06-24 2:54 PM
 * @UpdateBy jiangtao
 * @Version v1.0
 */
@Slf4j
@Controller
public class LoginController {

    /**
     * 前往登录页面
     * @param req
     * @return
     */
    @RequestMapping("login")
    public String login(HttpServletRequest req) {
        HttpSession session = req.getSession(true);
        session.setAttribute("username", "tom");

        return "redirect:index";
    }


}
